package com.yizhang.xml.service.impl;

import com.yizhang.xml.dao.UserDao;
import com.yizhang.xml.service.UserService;
import org.springframework.beans.factory.InitializingBean;

import java.util.List;
import java.util.Map;

public class UserServiceImpl implements UserService, InitializingBean {

    private UserDao userDao;

    private List<UserDao> userDaoList;

    private List<String> stringList;

    private Map<String, UserDao> userDaoMap;

    public UserServiceImpl() {
        System.out.println("UserServiceImpl实例化====================");
    }

    public void setUserDao(UserDao userDao) {
        System.out.println("UserServiceImpl设置属性userDao====================");
        this.userDao = userDao;
    }

    public void setUserDaoList(List<UserDao> userDaoList) {
        System.out.println("UserServiceImpl设置属性userDaoList====================");
        this.userDaoList = userDaoList;
    }

    public void setStringList(List<String> stringList) {
        System.out.println("UserServiceImpl设置属性stringList====================");
        this.stringList = stringList;
    }

    public void setUserDaoMap(Map<String, UserDao> userDaoMap) {
        System.out.println("UserServiceImpl设置属性userDaoMap====================");
        this.userDaoMap = userDaoMap;
    }

    @Override
    public void show() {
        System.out.println(userDao);
        System.out.println(userDaoList);
        System.out.println(stringList);
        System.out.println(userDaoMap);
    }

    @Override
    public void afterPropertiesSet() {
        System.out.println("InitializingBean.afterPropertiesSet===================");
    }
}
